def is_prime(n):
    if n < 2:
            return False
                for i in range(2, int(n**0.5) + 1):
                        if n % i == 0:
                                    return False
                                        return True

                                        def closest_prime(num):
                                            while not is_prime(num):
                                                    num += 1
                                                        return num

                                                        input_words = input("Введите три слова: ").split()
                                                        words_to_numbers = {
                                                                'zero': '0', 'one': '1', 'two': '2', 'three': '3',
                                                                    'four': '4', 'five': '5', 'six': '6', 'seven': '7',
                                                                        'eight': '8', 'nine': '9'
                                                        }

                                                        number = ''.join([words_to_numbers.get(word, '') for word in input_words])

                                                        if len(number) == 3 and number.isdigit():
                                                            number = int(number)
                                                                if 100 <= number <= 999:
                                                                        result = closest_prime(number)
                                                                                print(result)
                                                                                    else:
                                                                                            print("Wrong input")
                                                                                            else:
                                                                                                print("Wrong input")
                                                        }
